#include "USER.h"
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;

void Student::displayStudent()
{
	ofstream studentFile("reader.txt");
	if(!studentFile)
	{
		cout << "无法打开该文件！" << endl;
		exiit(0);
	}
	
	cout << "打开文件成功，现在开始输出学生借阅的图书信息：" << endl;
	while(!studentFile.eof())
	{
		studentFile >>  studentName;
		studentFile >> bookIndex;
		cout << studentName << endl;
		cout << bookIndex << endl;
	}
	studentFile.close();
}

void Teacher::displayTeacher()
{
	ofstream studentFile("readers.txt");
	if(!teacherFile)
	{
		cout << "无法打开该文件！" << endl;
		exiit(0);
	}
	
	cout << "打开文件成功，现在开始输出教师借阅的图书信息：" << endl;
	while(!teacherFile.eof())
	{
		teacherFile >>  teacherName;
		teacherFile >> bookIndex;
		cout << teacherName << endl;
		cout << bookIndex << endl;
	}
	teacherFile.close();
}

void Student::studentReturn()
{
	int bookName;
	fstream bookreturn;
	cout << "请输入您的学号:" << endl;
	cin >> studentID << endl;
 	cout << "请输入您要还的书的编号：" << endl;
 	cin >> bookName;
 	
 	
	
}